package chapter3;

import java.util.Scanner;

 class Person{
	private String name;
	private int age;
	private boolean gender;
	private int id;
	public Person() {
		System.out.println("This is constructor");
		System.out.println(name + "," + age + "," + gender + "," + id);
	}

	public Person(String name, int age, boolean gender) {
		this.name = name;
		this.age = age;
		this.gender = gender;
	}

	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}


	@Override
	public String toString() {
		return "Person [name=" + name + ", age=" + age + ", gender=" + gender
				+ ", id=" + id + "]";
	}

	public boolean isGender() {
		return gender;
	}

	public void setGender(boolean gender) {
		this.gender = gender;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

}


public class Test1 {

	

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		String na;
		boolean ge;
		int ag;
		Person[] p = new Person[n];
		for (int i = 0; i < n; i++) {
			na = in.next();
			ag = in.nextInt();
			ge = in.nextBoolean();
			p[i] = new Person(na, ag, ge);
		}
		for (int i = p.length - 1; i >= 0; i--) {
			System.out.println(p[i]);
		}

		Person p2 = new Person();
		System.out.println(p2);
	}

}
